// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1

Item {
    id: sprite
    clip: true
    property int frame: 0
    property int frameCount: 2
    property int grid_x: 2
    property int grid_y: 1
    property alias source:image.source
    property alias ma:mouse_area
    width:image.width/grid_x
    height: image.height/grid_y



    Image{
        id: image
        x: -sprite.width*(frame%grid_x)
    }

    MouseArea{
    	id: mouse_area
        anchors.fill: sprite
        hoverEnabled: true
        acceptedButtons: Qt.LeftButton
        onEntered: {
            sprite.frame = 1
        }
        onExited: {
            sprite.frame = 0
        }
    }
}
